import request from '@/utils/request'

// 获得学生列表 /students/getStudents
/* 
  @ param  any
     作为需要向后端传递的参数
     注意 get param
         post  body
*/
let getUsers = async (params) => {
    let result = await request({
        method: 'GET',
        url: '/user/getUsers',
        params: {
            ...params,
            role: "user"
        }
    })
    return result
}

let delUsers = async (params) => {
    let result = await request({
        method: 'post',
        url: '/user/delUser',
        data: {
            ...params,
            role: "users"
        }
    })
    return result
}

let updateUsers = async (params) => {
    let result = await request({
        method: 'post',
        url: '/user/updateUsers',
        data: {
            ...params,
            role: "users"
        }
    })
    return result
}

let addUsers = async (params) => {
    let result = await request({
        method: 'post',
        url: '/user/addUsers',
        data: {
            ...params,
            role: "users"
        }
    })
    return result
}

let findUser = async (params) => {
    let result = await request({
        method: 'post',
        url: '/user/findUser',
        data: {
            ...params,
        }
    })
    return result
}
export default {
    getUsers,
    delUsers,
    updateUsers,
    addUsers,
    findUser
}